package system.data;

import java.util.*;

import framework.core.*;
/*
	Author    :Arrow
	CreateTime:2009-05-12 09:11:45
*/
public class BillMoneyInputBase extends Table 
{
public static final String TABLE_NAME = "T_BILL_MONEY_INPUT";

private static final String BACKUP_TABLE_NAME = "T_BILL_MONEY_INPUT_BACKUP";

private static final String BACKUP_SEQ_NAME = "S_BILL_MONEY_INPUT_BACKUP";


public static final String ID = "ID";

public static final String WAREHOUSE_CODE = "WAREHOUSE_CODE";

public static final String WAREHOUSE_NAME = "WAREHOUSE_NAME";

public static final String PRODUCT_NAME = "PRODUCT_NAME";

public static final String SPEC = "SPEC";

public static final String MODEL = "MODEL";

public static final String UNIT = "UNIT";

public static final String COUNT = "COUNT";

public static final String PRICE = "PRICE";

public static final String MONEY = "MONEY";

public static final String PROVIDER_NAME = "PROVIDER_NAME";

public static final String BILL_TYPE = "BILL_TYPE";

public static final String BILL_DATE = "BILL_DATE";

public static final String CREATE_USER_ID = "CREATE_USER_ID";

public static final String CREATE_USER = "CREATE_USER";

public static final String CREATE_TIME = "CREATE_TIME";


public static Vector m_fields = null;


private String m_id = ""; //费用序号

private String m_warehouse_code = ""; //仓库编码

private String m_warehouse_name = ""; //仓库名称

private String m_product_name = ""; //产品名称

private String m_spec = ""; //规格

private String m_model = ""; //型号

private String m_unit = ""; //计量单位

private double m_count = Value.NULL_DOUBLE; //数量

private double m_price = Value.NULL_DOUBLE; //单价

private double m_money = Value.NULL_DOUBLE; //总价

private String m_provider_name = ""; //供应商名称

private String m_bill_type = ""; //费用类型

private String m_bill_date = ""; //费用日期

private String m_create_user_id = ""; //创建人序号

private String m_create_user = ""; //创建人

private String m_create_time = ""; //创建时间



	public String getId()
	{
	    return m_id;
	}
	public void  setId(String v)
	{
		if(getId().equals(v)) return ;
		m_id = v ;
		markDirty(ID);
	}



	

	public String getWarehouseCode()
	{
	    return m_warehouse_code;
	}
	public void  setWarehouseCode(String v)
	{
		if(getWarehouseCode().equals(v)) return ;
		m_warehouse_code = v ;
		markDirty(WAREHOUSE_CODE);
	}



	

	public String getWarehouseName()
	{
	    return m_warehouse_name;
	}
	public void  setWarehouseName(String v)
	{
		if(getWarehouseName().equals(v)) return ;
		m_warehouse_name = v ;
		markDirty(WAREHOUSE_NAME);
	}



	

	public String getProductName()
	{
	    return m_product_name;
	}
	public void  setProductName(String v)
	{
		if(getProductName().equals(v)) return ;
		m_product_name = v ;
		markDirty(PRODUCT_NAME);
	}



	

	public String getSpec()
	{
	    return m_spec;
	}
	public void  setSpec(String v)
	{
		if(getSpec().equals(v)) return ;
		m_spec = v ;
		markDirty(SPEC);
	}



	

	public String getModel()
	{
	    return m_model;
	}
	public void  setModel(String v)
	{
		if(getModel().equals(v)) return ;
		m_model = v ;
		markDirty(MODEL);
	}



	

	public String getUnit()
	{
	    return m_unit;
	}
	public void  setUnit(String v)
	{
		if(getUnit().equals(v)) return ;
		m_unit = v ;
		markDirty(UNIT);
	}



	

	public double getCount()
	{
	    return m_count;
	}
	public void  setCount(double v)
	{
		if(getCount()==v) return ;
		m_count = v ;
		markDirty(COUNT);
	}



	

	public double getPrice()
	{
	    return m_price;
	}
	public void  setPrice(double v)
	{
		if(getPrice()==v) return ;
		m_price = v ;
		markDirty(PRICE);
	}



	

	public double getMoney()
	{
	    return m_money;
	}
	public void  setMoney(double v)
	{
		if(getMoney()==v) return ;
		m_money = v ;
		markDirty(MONEY);
	}



	

	public String getProviderName()
	{
	    return m_provider_name;
	}
	public void  setProviderName(String v)
	{
		if(getProviderName().equals(v)) return ;
		m_provider_name = v ;
		markDirty(PROVIDER_NAME);
	}



	

	public String getBillType()
	{
	    return m_bill_type;
	}
	public void  setBillType(String v)
	{
		if(getBillType().equals(v)) return ;
		m_bill_type = v ;
		markDirty(BILL_TYPE);
	}



	

	public String getBillDate()
	{
	    return m_bill_date;
	}
	public void  setBillDate(String v)
	{
		if(getBillDate().equals(v)) return ;
		m_bill_date = v ;
		markDirty(BILL_DATE);
	}



	

	public String getCreateUserId()
	{
	    return m_create_user_id;
	}
	public void  setCreateUserId(String v)
	{
		if(getCreateUserId().equals(v)) return ;
		m_create_user_id = v ;
		markDirty(CREATE_USER_ID);
	}



	

	public String getCreateUser()
	{
	    return m_create_user;
	}
	public void  setCreateUser(String v)
	{
		if(getCreateUser().equals(v)) return ;
		m_create_user = v ;
		markDirty(CREATE_USER);
	}



	

	public String getCreateTime()
	{
	    return m_create_time;
	}
	public void  setCreateTime(String v)
	{
		if(getCreateTime().equals(v)) return ;
		m_create_time = v ;
		markDirty(CREATE_TIME);
	}



	



	public String viewId(DBConnection con) throws Exception
	{
		return Value.view(getId());
	}

	public String viewWarehouseCode(DBConnection con) throws Exception
	{
		return Value.view(getWarehouseCode());
	}

	public String viewWarehouseName(DBConnection con) throws Exception
	{
		return Value.view(getWarehouseName());
	}

	public String viewProductName(DBConnection con) throws Exception
	{
		return Value.view(getProductName());
	}

	public String viewSpec(DBConnection con) throws Exception
	{
		return Value.view(getSpec());
	}

	public String viewModel(DBConnection con) throws Exception
	{
		return Value.view(getModel());
	}

	public String viewUnit(DBConnection con) throws Exception
	{
		return Value.view(getUnit());
	}

	public String viewCount(DBConnection con) throws Exception
	{
		return Value.view(getCount());
	}

	public String viewPrice(DBConnection con) throws Exception
	{
		return Value.view(getPrice());
	}

	public String viewMoney(DBConnection con) throws Exception
	{
		return Value.view(getMoney());
	}

	public String viewProviderName(DBConnection con) throws Exception
	{
		return Value.view(getProviderName());
	}

	public String viewBillType(DBConnection con) throws Exception
	{
		return Value.view(getBillType());
	}

	public String viewBillDate(DBConnection con) throws Exception
	{
		return Value.view(getBillDate());
	}

	public String viewCreateUserId(DBConnection con) throws Exception
	{
		return Value.view(getCreateUserId());
	}

	public String viewCreateUser(DBConnection con) throws Exception
	{
		return Value.view(getCreateUser());
	}

	public String viewCreateTime(DBConnection con) throws Exception
	{
		return Value.view(getCreateTime());
	}



protected BillMoneyInputBase()
{
}

public void fill(BillMoneyInputPageData pageData) throws Exception
{

	if(pageData.getId()!=null)
	{	
		setId(pageData.getId());
	}

	if(pageData.getWarehouseCode()!=null)
	{	
		setWarehouseCode(pageData.getWarehouseCode());
	}

	if(pageData.getWarehouseName()!=null)
	{	
		setWarehouseName(pageData.getWarehouseName());
	}

	if(pageData.getProductName()!=null)
	{	
		setProductName(pageData.getProductName());
	}

	if(pageData.getSpec()!=null)
	{	
		setSpec(pageData.getSpec());
	}

	if(pageData.getModel()!=null)
	{	
		setModel(pageData.getModel());
	}

	if(pageData.getUnit()!=null)
	{	
		setUnit(pageData.getUnit());
	}

	if( pageData.getCount()!=null && 
	   !pageData.getCount().equals(""))
	{	
		setCount(Double.parseDouble(pageData.getCount()));
	}

	if( pageData.getPrice()!=null && 
	   !pageData.getPrice().equals(""))
	{	
		setPrice(Double.parseDouble(pageData.getPrice()));
	}

	if( pageData.getMoney()!=null && 
	   !pageData.getMoney().equals(""))
	{	
		setMoney(Double.parseDouble(pageData.getMoney()));
	}

	if(pageData.getProviderName()!=null)
	{	
		setProviderName(pageData.getProviderName());
	}

	if(pageData.getBillType()!=null)
	{	
		setBillType(pageData.getBillType());
	}

	if(pageData.getBillDate()!=null)
	{	
		setBillDate(pageData.getBillDate());
	}

	if(pageData.getCreateUserId()!=null)
	{	
		setCreateUserId(pageData.getCreateUserId());
	}

	if(pageData.getCreateUser()!=null)
	{	
		setCreateUser(pageData.getCreateUser());
	}

	if(pageData.getCreateTime()!=null)
	{	
		setCreateTime(pageData.getCreateTime());
	}

}

public String getTableName() 
{
	return TABLE_NAME;
}

public String getBackupTableName() 
{
	return BACKUP_TABLE_NAME;
}

public String getBackupSeqName() 
{
	return BACKUP_SEQ_NAME;
}

public java.util.Vector getFields() 
{
	if(m_fields==null)
	{
		m_fields = new Vector();

		m_fields.add(new Field(ID,Value.TYPE_STRING,true,true,32,"费用序号"));

		m_fields.add(new Field(WAREHOUSE_CODE,Value.TYPE_STRING,false,true,20,"仓库编码"));

		m_fields.add(new Field(WAREHOUSE_NAME,Value.TYPE_STRING,false,true,50,"仓库名称"));

		m_fields.add(new Field(PRODUCT_NAME,Value.TYPE_STRING,false,true,50,"产品名称"));

		m_fields.add(new Field(SPEC,Value.TYPE_STRING,false,false,200,"规格"));

		m_fields.add(new Field(MODEL,Value.TYPE_STRING,false,false,200,"型号"));

		m_fields.add(new Field(UNIT,Value.TYPE_STRING,false,true,20,"计量单位"));

		m_fields.add(new Field(COUNT,Value.TYPE_DOUBLE,false,true,0,"数量"));

		m_fields.add(new Field(PRICE,Value.TYPE_DOUBLE,false,true,0,"单价"));

		m_fields.add(new Field(MONEY,Value.TYPE_DOUBLE,false,true,0,"总价"));

		m_fields.add(new Field(PROVIDER_NAME,Value.TYPE_STRING,false,false,50,"供应商名称"));

		m_fields.add(new Field(BILL_TYPE,Value.TYPE_STRING,false,true,50,"费用类型"));

		m_fields.add(new Field(BILL_DATE,Value.TYPE_STRING,false,true,20,"费用日期"));

		m_fields.add(new Field(CREATE_USER_ID,Value.TYPE_STRING,false,false,32,"创建人序号"));

		m_fields.add(new Field(CREATE_USER,Value.TYPE_STRING,false,false,50,"创建人"));

		m_fields.add(new Field(CREATE_TIME,Value.TYPE_STRING,false,false,20,"创建时间"));
		
	}
	return m_fields;
}

public void initObject(java.sql.ResultSet rs) throws Exception
{

	m_id = getString(rs,ID);

	m_warehouse_code = getString(rs,WAREHOUSE_CODE);

	m_warehouse_name = getString(rs,WAREHOUSE_NAME);

	m_product_name = getString(rs,PRODUCT_NAME);

	m_spec = getString(rs,SPEC);

	m_model = getString(rs,MODEL);

	m_unit = getString(rs,UNIT);

	m_count = getDouble(rs,COUNT);

	m_price = getDouble(rs,PRICE);

	m_money = getDouble(rs,MONEY);

	m_provider_name = getString(rs,PROVIDER_NAME);

	m_bill_type = getString(rs,BILL_TYPE);

	m_bill_date = getString(rs,BILL_DATE);

	m_create_user_id = getString(rs,CREATE_USER_ID);

	m_create_user = getString(rs,CREATE_USER);

	m_create_time = getString(rs,CREATE_TIME);

	ms_new_flag = ConstDefine.NO;
}

public Value get(String f)
{

	if(f.equalsIgnoreCase(ID))
	{
		return new Value(getId());
	}

	if(f.equalsIgnoreCase(WAREHOUSE_CODE))
	{
		return new Value(getWarehouseCode());
	}

	if(f.equalsIgnoreCase(WAREHOUSE_NAME))
	{
		return new Value(getWarehouseName());
	}

	if(f.equalsIgnoreCase(PRODUCT_NAME))
	{
		return new Value(getProductName());
	}

	if(f.equalsIgnoreCase(SPEC))
	{
		return new Value(getSpec());
	}

	if(f.equalsIgnoreCase(MODEL))
	{
		return new Value(getModel());
	}

	if(f.equalsIgnoreCase(UNIT))
	{
		return new Value(getUnit());
	}

	if(f.equalsIgnoreCase(COUNT))
	{
		return new Value(getCount());
	}

	if(f.equalsIgnoreCase(PRICE))
	{
		return new Value(getPrice());
	}

	if(f.equalsIgnoreCase(MONEY))
	{
		return new Value(getMoney());
	}

	if(f.equalsIgnoreCase(PROVIDER_NAME))
	{
		return new Value(getProviderName());
	}

	if(f.equalsIgnoreCase(BILL_TYPE))
	{
		return new Value(getBillType());
	}

	if(f.equalsIgnoreCase(BILL_DATE))
	{
		return new Value(getBillDate());
	}

	if(f.equalsIgnoreCase(CREATE_USER_ID))
	{
		return new Value(getCreateUserId());
	}

	if(f.equalsIgnoreCase(CREATE_USER))
	{
		return new Value(getCreateUser());
	}

	if(f.equalsIgnoreCase(CREATE_TIME))
	{
		return new Value(getCreateTime());
	}
	
	return null;
}
public void set(String f,Value v) throws Exception
{

	if(f.equalsIgnoreCase(ID))
	{
		setId(v.getString());
	}

	if(f.equalsIgnoreCase(WAREHOUSE_CODE))
	{
		setWarehouseCode(v.getString());
	}

	if(f.equalsIgnoreCase(WAREHOUSE_NAME))
	{
		setWarehouseName(v.getString());
	}

	if(f.equalsIgnoreCase(PRODUCT_NAME))
	{
		setProductName(v.getString());
	}

	if(f.equalsIgnoreCase(SPEC))
	{
		setSpec(v.getString());
	}

	if(f.equalsIgnoreCase(MODEL))
	{
		setModel(v.getString());
	}

	if(f.equalsIgnoreCase(UNIT))
	{
		setUnit(v.getString());
	}

	if(f.equalsIgnoreCase(COUNT))
	{
		setCount(v.getDouble());
	}

	if(f.equalsIgnoreCase(PRICE))
	{
		setPrice(v.getDouble());
	}

	if(f.equalsIgnoreCase(MONEY))
	{
		setMoney(v.getDouble());
	}

	if(f.equalsIgnoreCase(PROVIDER_NAME))
	{
		setProviderName(v.getString());
	}

	if(f.equalsIgnoreCase(BILL_TYPE))
	{
		setBillType(v.getString());
	}

	if(f.equalsIgnoreCase(BILL_DATE))
	{
		setBillDate(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_USER_ID))
	{
		setCreateUserId(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_USER))
	{
		setCreateUser(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_TIME))
	{
		setCreateTime(v.getString());
	}
	
}
public String toString()
{
	String msg = "BillMoneyInput=\n";
	msg += "(\r\n";

	msg += "    费用序号(id)="+get("id")+"\r\n";

	msg += "    仓库编码(warehouse_code)="+get("warehouse_code")+"\r\n";

	msg += "    仓库名称(warehouse_name)="+get("warehouse_name")+"\r\n";

	msg += "    产品名称(product_name)="+get("product_name")+"\r\n";

	msg += "    规格(spec)="+get("spec")+"\r\n";

	msg += "    型号(model)="+get("model")+"\r\n";

	msg += "    计量单位(unit)="+get("unit")+"\r\n";

	msg += "    数量(count)="+get("count")+"\r\n";

	msg += "    单价(price)="+get("price")+"\r\n";

	msg += "    总价(money)="+get("money")+"\r\n";

	msg += "    供应商名称(provider_name)="+get("provider_name")+"\r\n";

	msg += "    费用类型(bill_type)="+get("bill_type")+"\r\n";

	msg += "    费用日期(bill_date)="+get("bill_date")+"\r\n";

	msg += "    创建人序号(create_user_id)="+get("create_user_id")+"\r\n";

	msg += "    创建人(create_user)="+get("create_user")+"\r\n";

	msg += "    创建时间(create_time)="+get("create_time")+"\r\n";
		
	msg += ")\r\n";
	return msg;
}
public void copyBase(BillMoneyInputBase srcObj)
{

	setWarehouseCode(srcObj.getWarehouseCode());

	setWarehouseName(srcObj.getWarehouseName());

	setProductName(srcObj.getProductName());

	setSpec(srcObj.getSpec());

	setModel(srcObj.getModel());

	setUnit(srcObj.getUnit());

	setCount(srcObj.getCount());

	setPrice(srcObj.getPrice());

	setMoney(srcObj.getMoney());

	setProviderName(srcObj.getProviderName());

	setBillType(srcObj.getBillType());

	setBillDate(srcObj.getBillDate());

	setCreateUserId(srcObj.getCreateUserId());

	setCreateUser(srcObj.getCreateUser());

	setCreateTime(srcObj.getCreateTime());

}

public String toXml() throws Exception
{
	String xml = "";
	xml += "<BillMoneyInput>";

	xml += "<Id>"+Value.view(getId())+"</Id>";

	xml += "<WarehouseCode>"+Value.view(getWarehouseCode())+"</WarehouseCode>";

	xml += "<WarehouseName>"+Value.view(getWarehouseName())+"</WarehouseName>";

	xml += "<ProductName>"+Value.view(getProductName())+"</ProductName>";

	xml += "<Spec>"+Value.view(getSpec())+"</Spec>";

	xml += "<Model>"+Value.view(getModel())+"</Model>";

	xml += "<Unit>"+Value.view(getUnit())+"</Unit>";

	xml += "<Count>"+Value.view(getCount())+"</Count>";

	xml += "<Price>"+Value.view(getPrice())+"</Price>";

	xml += "<Money>"+Value.view(getMoney())+"</Money>";

	xml += "<ProviderName>"+Value.view(getProviderName())+"</ProviderName>";

	xml += "<BillType>"+Value.view(getBillType())+"</BillType>";

	xml += "<BillDate>"+Value.view(getBillDate())+"</BillDate>";

	xml += "<CreateUserId>"+Value.view(getCreateUserId())+"</CreateUserId>";

	xml += "<CreateUser>"+Value.view(getCreateUser())+"</CreateUser>";

	xml += "<CreateTime>"+Value.view(getCreateTime())+"</CreateTime>";
	
	xml += "</BillMoneyInput>";
	return xml;
}

}
